package com.tedu.review.day02;

class Anceators{
    private String name="祖宗";   //私有属性

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
class Grandpa extends Anceators{
    String name="爷爷";
    private void tell(){
        System.out.println("你是："+getName());
    }
}
class Fater extends Grandpa{
    String name="父亲";
    public void tell(){
        System.out.println("你是："+getName());
    }
}
public class 继承问题1 {
    public static void main(String[] args) {
        Fater fater=new Fater();
        fater.tell();
    }
}
